import request from '../utils/requestContent'
const doudianBaseUrl = 'https://fxg.jinritemai.com/'


// 作废优惠券
export const delCoup = (id, data, tabid = '') => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/coupons/v1/shopcoupons/${id}`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    }, tabid)
}


// 检查商品是否可以参加这个时段的活动
// 检查链接是否满足活动
/**
 * @name 检查商品是否满足活动配置的要求
 * @param {*} data 
 * @param {*} tabid 
 * @returns 
 */
export const checkPromotionProductList = (data, tabid = '') => {
    return request({
        url: `marketing/promotion/v1/check_promotion_validation`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    }, tabid)
}


// 创建优惠券
export const createCoup = (data, tabid = '') => {
    // console.log('data66552145', data)
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/coupons/v1/shopcoupons`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    }, tabid)
}

// 获取店铺信息
export const getShopInfoData = (data, tabid = '') => {
    return request({
        baseURL: doudianBaseUrl,
        url: `common/index/index`,
        method: "get",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    }, tabid)
}